package com.sankuai.core.thread;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Author：YH
 * @Description：
 * @Date:Created in 2022/5/19 19:41
 */
public class JobRegistryMonitorHelper {

    private static final Logger LOGGER = LoggerFactory.getLogger(JobRegistryMonitorHelper.class);

    private static JobRegistryMonitorHelper instance = new JobRegistryMonitorHelper();

    public static JobRegistryMonitorHelper getInstance() {
        return instance;
    }

    private Thread registryThread;

    private volatile boolean toStop = false;


    public void start() {
        registryThread = new Thread(new Runnable() {
            @Override
            public void run() {
                while (!toStop) {
                    LOGGER.info("JobRegistryMonitorHelper多线程启动");
                    // auto registry group
                }
            }
        });
        registryThread.setDaemon(true);
        registryThread.setName("xxl-job,admin JobRegistryMonitorHelper");
        registryThread.start();
    }
}
